<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>相关配置</title>
    <link rel="stylesheet" href="../css/main.min.css">
    <script src="../js/main.min.js"></script>
    <script src="../base/core.js"></script>
</head>
<body>
<div class="container-fluid" ng-app="myApp" ng-controller="configController">
    <div class="row">
        <div class="form-group">
            <label>故障分组</label>
            <select class="form-control" data-ng-model="type" data-ng-options="x.title for x in category" ng-change="loadConfigure()"></select>
        </div>
    </div>
    <div class="row">
        <div class="panel">
            <div class="panel-heading">操作&nbsp;<a href="javascript:;" class="btn btn-default" ng-click="appendItem()">添加项</a></div>
            <div class="panel-body">
                <table class="table table-responsive table-bordered">
                    <thead><tr>
                        <th>id</th><th>名称</th><th>类别</th><th>操作</th>
                    </tr></thead>
                    <tbody>
                    <tr ng-repeat="item in items track by $index" ng-class="item.$state">
                        <td>{{$index+1}}</td>
                        <td>
                            <span ng-hide="item.$onEdited">{{item.name}}</span>
                            <input ng-show="item.$onEdited" class="form-control" placeholder="名称" data-ng-model="item.name" />
                        </td>
                        <td>
                            <span ng-hide="item.$onEdited">{{item.category}}</span>
                            <select ng-show="item.$onEdited" class="form-control"
                                    data-ng-model="item.category"
                                    data-ng-options="x for x in ['汽轮发电机','水轮发电机','汽轮机','锅炉','水轮机','辅机']"
                            ></select>
                            <!--<select ng-show="item.$onEdited" class="form-control" placeholder="类别" data-ng-model="item.category" />-->
                        </td>
                        <td>
                            <input ng-show="item.$onEdited" type="button" class="btn btn-default" ng-click="persistItem(item)" value="确认修改">
                            <a href="javascript:;" class="btn btn-default" ng-click="modifyItem(item)">修改</a>
                            <a href="javascript:;" class="btn btn-default" ng-click="deleteItem($index)">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script src="FaultConfigure.js" ></script>
</body>
</html>